package demolinkedlist;

import java.util.LinkedList;
import java.util.ListIterator;

/**
 * @Author 12629
 * @Description：
 */
public class Test {


    public static void main(String[] args) {
        LinkedList<Integer> list = new LinkedList<>();
        list.addLast(1);
        list.addLast(2);
        list.addLast(3);
        list.addFirst(9);

        System.out.println(list);

        ListIterator<Integer> it = list.listIterator();
        while (it.hasNext()) {
            System.out.print(it.next()+" ");
        }
    }
    public static void main1(String[] args) {
        MyLinkedList myLinkedList = new MyLinkedList();
        myLinkedList.addLast(4);
        myLinkedList.addLast(4);
        myLinkedList.addLast(4);
        myLinkedList.addLast(4);//ctr+d
        myLinkedList.display();
        myLinkedList.removeAllKey(4);
        myLinkedList.display();

        //myLinkedList.addIndex(2,19);//ctr+d

        //myLinkedList.display();
    }
}
